#include <Def.h>
#include <qdebug.h>
#include "HandlePrivate.h"

bool HandlerPrivate::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
{
	if(ea.getEventType() == ea.RESIZE)
	{
		int width = ea.getWindowWidth();
		int height = ea.getWindowHeight();
		GLOBAL_OSG_WINDOWMANAGER->setWindowSize(width,height);
		GLOBAL_OSG_WINDOWMANAGER->setSize(width,height);
		return true;
	}
	else if(ea.getEventType() == ea.KEYUP)
	{
		if(ea.getKey() == 'd')
		{
			qDebug()<<"click key d ";
			sdkCore->onClickAddon();
		}
	}

	return false;
}